// SCENARIO SCRIPT

// This is the special script for your entire scenario. It contains
// special encounters and code accessable from anywhere in the scenario. it also
// contains the code that initializes important special things in the
// scenario (like shops and names and descriptions of special items).

// You can create your own states, but you should give all of them numbers greater than
// or equal to 10.

beginscenarioscript;

variables;

int i;

body;

beginstate LOAD_SCEN_STATE;
// This is the state that is called every time the scenario is loaded,
// even when a save file in the scenario is loaded. Some things that should go here:
//    Names and descriptions of special items.
//    Names and effects of custom special abilities.
break;

beginstate START_SCEN_STATE;
// This is the state that is called only once at the very beginning of 
// the scenario. Some things that should go here:
//    The stuff in shops.
//    Creating horses and boats.

message_dialog("For atmosphere purposes your party's skill with the mage spell _Light_ has been removed for this scenario.","Upon completion the party will have this spell restored completely.");

set_flag(250,0,(get_spell_level(0,0,1)));
set_flag(250,1,(get_spell_level(1,0,1)));
set_flag(250,2,(get_spell_level(2,0,1)));
set_flag(250,3,(get_spell_level(3,0,1)));

i = 0;

while(i < 4) {
	
	if(get_spell_level(i,0,1) > 0) {
		change_spell_level(i,0,1,(-1 * get_flag(250,i)));
	}
	i = i + 1;
}

break;

beginstate START_STATE;
// This state is called every tick wherever the party is in the scenario.
// You can use the set_state
break;

// Place your own states below. Give each a number at least 10.
beginstate 10;
break;
